home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 June / 1984-06.d64 / spell critter_64 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  117 lines

  1. 10 poke52,48:poke56,48:clr
  2. 20 poke53281,1:print"[147]":poke53281,6:poke53280,6
  3. 30 s=54272:v=54296:ad=54277:sr=54278:hf=54273:lf=s:sd=54276
  4. 40 forl=stos+24:pokel,0:next:pokead,14:pokesr,204
  5. 50 fori=1436to1443:pokei,int(rnd(1)*25)+1:next:fori=1445to1451
  6. 60 pokei,int(rnd(1)*25)+1:next:fori=1 to 500:next
  7. 70 fori=1436to1443:readl:pokei,l+128:gosub110:forj=1to70:nextj:pokesd,32:nexti
  8. 80 fori=1445to1451:readl:pokei,l+128:gosub110:forj=1to70:nextj:pokesd,32:nexti
  9. 90 data19,16,5,12,12,9,14,7,3,18,9,20,20,5,18
  10. 100 poke1444,160:goto 120
  11. 110 pokev,15:pokehf,40:pokelf,50:pokesd,33:pokev,0:return
  12. 120 print"one moment................please!"
  13. 130 printchr$(142):poke56334,peek(56334)and254
  14. 140 poke1,peek(1)and251:fori=0to511:pokei+12288,peek(i+53248):next
  15. 150 poke1,peek(1)or4:poke56334,peek(56334)or1
  16. 160 fori=1to3:readw:forc=wtow+7:reada:pokec,a:nextc:nexti
  17. 170 data12288,96,128,77,63,31,13,0,0
  18. 180 data12784,3,52,184,240,240,184,52,3
  19. 190 data12776,0,54,58,242,242,58,54,0
  20. 200 dimw$(50):cl=54272
  21. 210 forj=1to7:readm$(j):nextj
  22. 220 poke53272,(peek(53272)and240)or12
  23. 230 poke53281,1:print"[147]":poke53281,6:poke53280,6
  24. 240 r=1464:j=1:gosub450:gosub850
  25. 250 n$=nm$:poke53272,21
  26. 260 gosub710:poke53281,1:print"[147]":poke53281,6:poke53280,6
  27. 270 wg=0:rt=0
  28. 280 forb=1ton
  29. 290 print"[147]":poke214,12:print:poke211,int((40-len(w$(b)))/2)-1:printw$(b)
  30. 300 fort=1to1000:next
  31. 310 print"[147]     to review the word press ? key"
  32. 320 poke53272,28:r=1464:j=2:gosub450:gosub850
  33. 330 a$=nm$
  34. 340 ifa$="that word"thenj=6:r=1704:gosub1020:gosub450:r=1544:gosub790:goto290
  35. 350 ifasc(a$)=63orasc(a$)=47then290
  36. 360 ifa$=w$(b)thengosub1020:j=5:m$(j)=m$(j)+" "+n$:r=1704:gosub450
  37. 370 ifj=5thenrt=rt+1:gosub400:gosub570:goto560
  38. 380 wg=wg+1:gosub1020:j=3:m$(j)=m$(j)+" "+n$:r=1704:gosub450:gosub570
  39. 390 j=4:r=1824:m$(j)=m$(j)+" "+w$(b):gosub450:r=1544:gosub790:gosub570
  40. 395 m$(j)="the correct answer is:":goto590
  41. 400 rem correct answer sound
  42. 410 pokev,15:pokesd,17:fors=40to100
  43. 420 pokehf,int(rnd(1)*100+40):pokelf,s:ford=1to20:next
  44. 430 next:pokesd,16:return
  45. 440 rem message routine
  46. 450 c=((r-1024)/40)-1:cn=int((40-len(m$(j)))/2)-1
  47. 460 fori=1tolen(m$(j)):lr=r+cn+i:iflr>2023thenlr=2023
  48. 470 fork=1to20:nextk:pokelr+1,32
  49. 480 pokelr,0:pokelr+1,62:pokelr+cl,1:pokelr+cl+1,1:gosub110:pokesd,32
  50. 490 fork=1to20:nextk:pokelr,32
  51. 500 a=asc(mid$(m$(j),i,1)):ifa=32thenpokelr,a:goto530
  52. 510 ifa<65ora>90thenpoke214,c:print:poke211,cn+i:printchr$(a):goto530
  53. 520 ch=a-64:pokelr,ch:pokelr+cl,1
  54. 530 nexti
  55. 540 ford=lr+1tor+38:poked,0:poked+1,62:poked+cl,3:poked+cl+1,3:gosub110
  56. 550 pokesd,32:fork=1to10:nextk:poked,32:poked+1,32:nextd:return
  57. 560 poke198,0:print"hit any key":goto 580
  58. 570 m$(j)=mid$(m$(j),1,len(m$(j))-len(n$)-1):return
  59. 580 getz$:ifz$=""then580
  60. 590 nextb
  61. 600 rem game over routine
  62. 610 poke53272,21:print"[147]the game is over"
  63. 620 print"right";tab(33);"wrong"
  64. 630 print"";rt;tab(33);wg
  65. 640 print"  would you like to play again (y/n)?"
  66. 650 getz$:ifz$=""or(z$<>"y"andz$<>"n")then650
  67. 660 ifz$="y"thenfori=1ton:w$(i)="":next:goto260
  68. 670 print"[147]   it has been very nice spelling          with you ";n$;"."
  69. 680 print"    please come back to play again."
  70. 690 poke53272,28:r=1704:j=7:gosub450:poke53272,21:end
  71. 700 rem input
  72. 710 poke53280,3:poke53281,3
  73. 720 print"[147]how many words do we have today";:inputz$:n=val(z$)
  74. 725 ifn>50orn=0then720
  75. 730 print"[147]         [160]check your spelling!![146]"
  76. 740 forx=1ton
  77. 750 poke214,12:print:poke211,5:print"enter word # ";x;:input"[157]";w$(x)
  78. 760 fori=1to17:poke214,12:print:poke211,21+i:printchr$(32):nexti
  79. 765 iflen(w$(x))=0orlen(w$(x))>10then750
  80. 766 ifasc(w$(x))<65orasc(w$(x))>90then750
  81. 770 nextx:return
  82. 780 rem erase routine
  83. 790 fori=rtor+38
  84. 800 ch=62:if(i+1)/2=int((i+1)/2)thench=61
  85. 810 pokei+cl,1:pokei+cl+1,1
  86. 820 pokei,0:pokei+1,ch:ford=1to50:nextd
  87. 830 pokei,32:gosub110:pokesd,32:nexti:pokei,32:return
  88. 840 rem answer routine
  89. 850 poke198,0:poke1561+cl,1:poke1562+cl,1:poke1561,0:poke1562,62:ct=1:nm$=""
  90. 860 getz$:ifz$=""then860
  91. 870 ifasc(z$)=63orasc(z$)=47thennm$=z$:return
  92. 880 ifasc(z$)=32thena=32:goto920
  93. 890 ifasc(z$)=13andlen(nm$)<>0then950
  94. 900 ifasc(z$)<65orasc(z$)>90then860
  95. 910 a=asc(z$)-64
  96. 920 nm$=nm$+z$:poke1560+ct,a:poke1561+ct,0:poke1561+ct+1,62
  97. 930 poke1560+ct+cl,1:poke1561+ct+cl,1:poke1561+ct+cl+1,1:ct=ct+1
  98. 940 gosub110:pokesd,32:goto860
  99. 950 ifj<>1thenreturn
  100. 960 fori=1561to1582:pokei,32:forj=1tolen(nm$)
  101. 970 a=i+j:ifa>1582thena=1582:pokea,32:goto 990
  102. 975 as=asc(mid$(nm$,j,1)):ifas<65oras>90thenpokea,32:goto990
  103. 980 pokea+cl,1:pokea,as-64
  104. 990 nextj:a=i+j+1:ifa>1582thena=1582:pokea,32:goto 1010
  105. 1000 pokea-1+cl,1:pokea+cl,1:pokea-1,0:pokea,62
  106. 1010 fork=1to30:nextk:gosub110:pokesd,32:nexti:return
  107. 1020 fori=1561+len(nm$)to1581
  108. 1030 pokei+cl,1:pokei+1+cl,1:pokei+2+cl,1:pokei,32:pokei+1,0:pokei+2,62
  109. 1040 gosub110:pokesd,32:nexti:pokei,32:pokei+1,32:return
  110. 1050 data"hi, what is your name"
  111. 1060 data"how do you spell that word"
  112. 1070 data"i'm sorry, that is wrong"
  113. 1080 data"the correct answer is:"
  114. 1090 data"that is right, very good"
  115. 1100 data"very funny, wiseguy"
  116. 1110 data"bye!  bye!  bye!"
  117.